feat(ui,sdk,shared): add UI test coverage and dual ESM+CJS builds - #18
Closed
starfishkrq wants to merge 2 commits into
Closed
starfishkrq wants to merge 2 commits into
starfishkrq wants to merge 2 commits into
Conversation
Issue #8 — expand @lumio/ui test coverage: - Add Card, CardTitle, CardBody render tests (children + className merge + ref) - Add Input tests: default type=text, placeholder, disabled, className merge - Add Button size variants (sm, md, lg) and secondary/ghost variant tests - Add all Badge variants: neutral, lumen, coral, sky (teal already covered) - 27 tests total, all passing (up from 6) Issue #9 — ship dual ESM + CJS builds for all three packages: - Add tsconfig.esm.json per package (module: ESNext, moduleResolution: Bundler, outDir: dist/esm) - Update tsconfig.json per package to output CJS into dist/cjs (was dist/) - Update build script in each package.json: tsc -p tsconfig.json && tsc -p tsconfig.esm.json - Update package.json exports with import/require/types conditions for . entry - @lumio/ui also exposes ./tailwind-preset with both import and require conditions - main points to dist/cjs/index.js; module field points to dist/esm/index.js
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
closes #8
closes #9
This PR implements both open issues in a single cohesive change.
Issue #8 — Expand
@lumio/uitest coverageFile changed:
packages/ui/src/ui.test.tsxAdded tests following the existing patterns in the file:
className, forwardsref(Card)typeto"text", forwardsplaceholder, forwardsdisabled, mergesclassNamesecondaryandghostvariant class assertions;sm,md(default),lgsize class assertionsneutral(default),lumen,teal(pre-existing),coral,skyResult: 27 tests, all passing (up from 6).
Issue #9 — Dual ESM + CJS builds for all three packages
Strategy: two
tscinvocations per package — no new runtime dependencies needed.@lumio/shareddist/cjs/dist/esm/@lumio/sdkdist/cjs/dist/esm/@lumio/uidist/cjs/dist/esm/Per-package changes:
tsconfig.json—outDirupdated fromdisttodist/cjstsconfig.esm.json(new) —module: ESNext,moduleResolution: Bundler,outDir: dist/esm; usesBundlerresolution to support extensionless imports without requiring.jssuffixes in sourcepackage.json—buildscript runs both configs;exportsmap updated withimport/require/typesconditions;mainpoints todist/cjs/index.js,modulepoints todist/esm/index.js@lumio/ui./tailwind-presetsub-path also gets bothimportandrequireconditionsValidation
pnpm lintgreenpnpm typecheckgreenpnpm buildgreen (all 3 packages, both CJS + ESM outputs)pnpm testgreen (55 tests: 27 UI + 25 shared + 3 sdk)Smoke-check: ESM
dist/esm/index.jsopens withexport */export {; CJSdist/cjs/index.jsopens withObject.defineProperty(exports, "__esModule").